package Terminal.UI;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JLabel;
import javax.swing.JPanel;

public class PanelLabel extends PanelComponent{

	protected JLabel label;
	
	public PanelLabel(PanelComponent parent){
		super(parent);
		pannellocomponente = new JPanel();
		label = new JLabel("label");
		}
	
	public PanelLabel(PanelComponent parent, JLabel label){
		super(parent);
		pannellocomponente = new JPanel();
		this.label=label;
	}
	
	@Override
	public JPanel createComponents() {
		label.setBackground(Color.white);
		pannellocomponente.setBackground(Color.white);
		//label.setLocation(1,1);
		
		/*label.setPreferredSize(new Dimension(100, 25));
		label.setMinimumSize(new Dimension(100, 25));
		label.setMaximumSize(new Dimension(100, 25));*/
		pannellocomponente.add(label);
		setSize(label.getPreferredSize().width, label.getPreferredSize().height);
		System.out.print(label.getPreferredSize().width+","+label.getPreferredSize().height);

		label.setVisible(true);
		label.setEnabled(true);
		pannellocomponente.setVisible(true);
		return pannellocomponente;
	}
	
	public JLabel getLabel(){
		return label;
	}
	
	public void setLabel(JLabel label){
		this.label=label;
		this.label.setPreferredSize(new Dimension(100, 25));
		this.label.setMinimumSize(new Dimension(100, 25));
		this.label.setMaximumSize(new Dimension(100, 25));
		setSize(this.label.getPreferredSize());
		
	}
	
	public void updateSize(){}

}
